public class Person {
    String name;
    String s = "hello world";
    String s1 = "hello world";
}
class Student extends Person implements Comparable<Student>{
    int age;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", s='" + s + '\'' +
                ", s1='" + s1 + '\'' +
                '}';
    }

    Student(String name, int age){
        this.age=age;
        this.name=name;
    }
    @Override
    public boolean equals(Object o) {
        Student tmp=(Student)o;
        return this.name.equals(tmp.name)&&this.age==tmp.age;
    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }
}
class Test{
    public static void main(String[] args) {
        Student student=new Student(" 张三",20);
        Student student1=new Student(" 张三",10);
        System.out.println(student1.equals(student));
     }
}